using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Toenda.Rails.System;
using Toenda.Rails.DataContainer;

public partial class Controls_ctrl_topmenu_public : System.Web.UI.UserControl {
	private AccountProvider ap = new AccountProvider();

	/// <summary>
	/// Page_Load
	/// </summary>
	/// <param name="sender"></param>
	/// <param name="e"></param>
	protected void Page_Load(object sender, EventArgs e) {
		string id = "";

		if(Request.QueryString.Get("id") != null) {
			id = Request.QueryString.Get("id").ToString();
		}

		switch(id) {
			case "dashboard":
				mnuMainPublic.Items[0].Selected = true;
				break;

			case "explore":
				mnuMainPublic.Items[1].Selected = true;
				break;

			case "tags":
				mnuMainPublic.Items[2].Selected = true;
				break;

			case "cameras":
				mnuMainPublic.Items[3].Selected = true;
				break;

			default:
				if(id == "") {
					mnuMainPublic.Items[0].Selected = true;
				}
				break;
		}

		NameValueCollection sv = Request.ServerVariables;

		if(sv["URL"] == "/search.aspx"
		|| sv["URL"] == "/search.aspx"
		|| sv["URL"] == "/WebClient/search.aspx"
		|| sv["URL"] == "/WebClient/search.aspx") {
			mnuMainPublic.Items[4].Selected = true;
		}
	}
}
